<?php $this->import('Header') ?>
<?php $this->import('User/Top') ?>
	<div class="container">
		<div class="well well-sm dog-info dog-photo">
			<p class="bg-title title">
				<span>我的照片</span>
				<a class="right" href="/home/morephoto.html"><i class="glyphicon glyphicon-th-list"></i> 更多</a>
			</p>
			<div class="photo-box">
				<?php foreach ($photos as $p) { ?>
					<a href="/dog/photo/detail_<?php echo $p['PhotoId'] ?>.html" class="thumbnail"><img data-src="<?php echo \Util\User::getUserPhotoRectangle($p['Path'], 400) ?>"></a>
				<?php } ?>
				<a href="javascript:;" class="thumbnail js-show-up">
					<i class="glyphicon glyphicon-picture up-icon"></i>
					<span class="up-info" href="">上传照片</span>
				</a>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="well well-sm dog-info">
			<p class="bg-title title">
				<span>我的帖子</span>
				<a class="right" href="/home/moresingle.html"><i class="glyphicon glyphicon-th-list"></i> 全部帖子</a>
				<a class="right" href="/single/add.html"><i class="glyphicon glyphicon-plus"></i> 发新帖</a>
			</p>
			<div class="row">
				<div class="col-xs-10">
					<?php if ($articles) { ?>
						<?php foreach ($articles as $article) { ?>
							<div class="article-item row">
								<div class="col-xs-8 tit">
									<a href="/single/detail_<?php echo $article['ArticleId'] ?>.html"><?php echo $article['Title'] ?></a>
								</div>
								<div class="col-xs-4 do">
									<span><?php echo date('Y-m-d H:i:s', $article['CreateTime']) ?></span>&nbsp;&nbsp;
									<a href="/single/edit_<?php echo $article['ArticleId'] ?>.html">编辑</a>
									<a href="javascript:;" class="js-article-del" articleId="<?php echo $article['ArticleId'] ?>">删除</a>
								</div>
							</div>
						<?php } ?>
					<?php } else { ?>
						<h4 class="none">一篇也没找到！马上<a href="/single/add.html">发布一篇</a>吧？</h4>
					<?php } ?>
				</div>
				<div class="col-xs-2 list-category">
					<div class="tit">分类（<?php echo $articlePager->count ?>）</div>
					<div class="list">
						<?php foreach($categoryInfoAndNumbers as $val) { ?>
							<a class="c1" href="javascript:;"><?php echo $val['CategoryName'] ?></a>
							<div class="item">
								<?php foreach($val['List'] as $v) { ?>
									<a class="c2" href="javascript:;"><?php echo $v['CategoryName'] ?>（<?php echo $v['Number'] ?>）</a>
								<?php } ?>
							</div>
						<?php } ?>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="well dog-info">
			<p class="bg-title title">
				<span>我的狗信息</span>
				<a class="right" href="/setting.html"><i class="glyphicon glyphicon-edit"></i> 编辑</a>
			</p>
			<div class="desc">
				<dl>
					<dd>
						<div class="row">
							<div class="col-xs-12"><span class="t">家乡：</span><?php echo implode('', $_city) ?></div>
							<div class="col-xs-4"><span class="t">品种：</span><?php echo $userInfo['breed'] ?></div>
							<div class="col-xs-8"><span class="t">是否绝育：</span><?php echo $userInfo['Sterilization'] ? '是' : '否' ?></div>
							<div class="col-xs-4"><span class="t">婚姻：</span>
								<?php if ($userInfo['HasChildren'] == \Data\User::HAS_CHILDREN_YES) { ?>
									已孕过
								<?php } else if ($userInfo['HasChildren'] == \Data\User::HAS_CHILDREN_NO) { ?>
									未孕过
								<?php } else if ($userInfo['HasChildren'] == \Data\User::HAS_CHILDREN_KEEP) { ?>
									保密
								<?php } ?>
							</div>
							<div class="col-xs-8"><span class="t">年龄：</span><?php echo \Util\User::getOld($userInfo['Birthday'])?>
							</div>
							<div class="col-xs-4"><span class="t">性别：</span><?php echo $userInfo['Sex'] == '1' ? 'GG' : 'MM' ?></div>
							<div class="col-xs-8"><span class="t">体重：</span><?php echo $userInfo['Weight'] ? $userInfo['Weight'] . '千克' : '' ?></div>
							<div class="col-xs-4"><span class="t">体长：</span><?php echo $userInfo['Length'] ? $userInfo['Length'] . '厘米' : '' ?></div>
							<div class="col-xs-8"><span class="t">肩高：</span><?php echo $userInfo['Height'] ?></div>
							<div class="col-xs-4"><span class="t">毛色：</span><?php echo $userInfo['Color'] ?></div>
							<div class="col-xs-8"><span class="t">饮食习惯：</span><?php if (in_array(\Data\User::EATING_HABITS_DOG_FOOD, explode(',', $userInfo['EatingHabits']))) { ?>
									<span class="">狗粮</span>
								<?php } ?>
								<?php if (in_array(\Data\User::EATING_HABITS_DOG_MIXED, explode(',', $userInfo['EatingHabits']))) { ?>
									<span class="">混合食物</span>
								<?php } ?>
								<?php if (in_array(\Data\User::EATING_HABITS_DOG_DIY, explode(',', $userInfo['EatingHabits']))) { ?>
									<span class="">自制狗粮</span>
								<?php } ?></div>
						</div>
					</dd>
				</dl>
			</div>
		</div>
		<div class="well dog-info">
			<p class="bg-title title">
				<span>我的交友条件</span>
				<a class="right js-show-hide-edit" href="javascript:;"><i class="glyphicon glyphicon-edit"></i> 编辑</a>
			</p>
			<div class="desc">
				<dl>
					<dd>
						<div class="row">
							<div class="col-xs-4"><span class="t">品种：</span><?php echo $userCondition['breedNames'] ? $userCondition['breedNames'] : '不限' ?></div>
							<div class="col-xs-8"><span class="t">地区：</span><?php echo $userCondition['cityName'] ?></div>
							<div class="col-xs-4"><span class="t">年龄：</span><?php echo $userCondition['Age'] ? $userCondition['Age'] . '岁' : '不限' ?></div>
							<div class="col-xs-8"><span class="t">性别：</span><?php
								if ($userCondition['Sex'] == 1) {
									echo 'GG';
								} else if ($userCondition['Sex'] == 2) {
									echo 'MM';
								} else {
									echo '不限';
								}
							?></div>
							<div class="col-xs-4"><span class="t">体重：</span><?php echo $userCondition['Weight'] ? $userCondition['Weight'] . '千克' : '不限' ?></div>
							<div class="col-xs-8"><span class="t">体长：</span><?php echo $userCondition['Length'] ? $userCondition['Length'] . '厘米' : '不限' ?></div>
							<div class="col-xs-4"><span class="t">肩高：</span><?php echo $userCondition['Height'] ? $userCondition['Height'] . '厘米' : '不限' ?></div>
							<div class="col-xs-8"><span class="t">毛色：</span><?php echo $userCondition['Color'] ? $userCondition['Color'] : '不限' ?></div>
						</div>
					</dd>
				</dl>
			</div>
			<div class="desc" style="display: none;">
				<dl><dd>
					<form id="js-condition">
						<div class="row form-inline">
							<div class="col-xs-12">
								<div class="form-group">
									<input type="hidden" name="city" id="js-city-input">
									<label class="t city">所在地区：</label><div id="city"></div></label>
								</div>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-4">
								<div class="form-group">
									<label class="t">品种：</label>
									<div class="input-group">
										<input id="js-input-breed" type="text" value="<?php echo $userCondition['breedNames'] ?>" name="breed" class="form-control" placeholder="品种">
									</div>
								</div>
							</div>
							<div class="col-xs-8">
								<div class="form-group">
									<label class="t">性别：</label>
									<div class="input-group">
										<label><input type="radio" value="0" name="sex" checked  /> 都可以</label>&nbsp;&nbsp;&nbsp;
										<label><input type="radio" value="1" name="sex" /> GG</label>&nbsp;&nbsp;&nbsp;
										<label><input type="radio" value="2" name="sex" /> MM</label>&nbsp;&nbsp;&nbsp;
									</div>
								</div>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-4">
								<div class="form-group">
									<label class="t">年龄：</label>
									<div class="input-group">
										<input type="number" value="" name="age" class="form-control" placeholder="年龄">
										<div class="input-group-addon">岁</div>
									</div>
								</div>
							</div>
							<div class="col-xs-8">
								<div class="form-group">
									<label class="t">体重：</label>
									<div class="input-group">
										<input type="number" value="" name="weight" class="form-control" placeholder="体重">
										<div class="input-group-addon">千克</div>
									</div>
								</div>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-4">
								<div class="form-group">
									<label class="t">体长：</label>
									<div class="input-group">
										<input type="number" value="" name="length" class="form-control" placeholder="体长">
										<div class="input-group-addon">厘米</div>
									</div>
								</div>
							</div>
							<div class="col-xs-8">
								<div class="form-group">
									<label class="t">肩高：</label>
									<div class="input-group">
										<input type="number" value="" name="height" class="form-control" placeholder="肩高">
										<div class="input-group-addon">厘米</div>
									</div>
								</div>
							</div>
							<div class="col-xs-4">
								<div class="form-group">
									<label class="t">毛色：</label>
									<div class="input-group">
										<input type="text" value="" name="color" class="form-control" placeholder="毛色">
									</div>
								</div>
							</div>
							<div class="col-xs-8">
								<a href="javascript:;" class="btn btn-default" onclick="$(this).closest('.well').find('.js-show-hide-edit').click()">取消</a>&nbsp;&nbsp;&nbsp;&nbsp;
								<button type="submit" class="btn btn-success">保存</button>
							</div>
							<div class="clearfix"></div>
						</div>
					</form>
				</dd></dl>
			</div>
		</div>
		<div class="well dog-info">
			<p class="bg-title title">
				<span>我主人的资料</span>
				<a class="right js-show-hide-edit" href="javascript:;"><i class="glyphicon glyphicon-edit"></i> 编辑</a>
			</p>
			<div class="desc">
				<?php if ($userMasterInfo) { ?>
					<dl>
						<dt><i class="glyphicon glyphicon-paperclip"></i>对主人的评价</dt>
						<dd><?php echo $userMasterInfo['Desc'] ?></dd>
					</dl>
					<dl>
						<dt><i class="glyphicon glyphicon-paperclip"></i>主人的详细资料</dt>
						<dd>
							<div class="row">
								<div class="col-xs-4"><span class="t">昵称：</span><?php echo $userMasterInfo['Nickname'] ?></div>
								<div class="col-xs-8"><span class="t">性别：</span><?php echo $userMasterInfo['Sex'] == 1 ? '帅哥' : '美女' ?></div>
								<div class="col-xs-4"><span class="t">年龄：</span><?php echo \Util\User::getOld($userMasterInfo['Birthday'])?></div>
								<div class="col-xs-8"><span class="t">养狗经验：</span><?php echo $userMasterInfo['Experience'] ? $userMasterInfo['Experience'] . '个月' : '-' ?></div>
								<div class="col-xs-4"><span class="t">职业：</span><?php echo $userMasterInfo['Profession'] ? $userMasterInfo['Profession'] : '-' ?></div>
								<div class="col-xs-8"><span class="t">狗狗个数：</span><?php echo $userMasterInfo['DogNumber'] ? $userMasterInfo['DogNumber'] . '个' : '-' ?></div>
							</div>
						</dd>
					</dl>
				<?php } else { ?>
					<dl><dt><h3>您还没有更新主人信息哦！马上去<a href="javascript:;" onclick="$(this).closest('.well').find('.js-show-hide-edit').click()">修改</a>吧</h3></dt></dl>
				<?php } ?>
			</div>
			<div class="desc" style="display: none;">
				<dl><dd>
					<form id="js-user-master-edit-form">
						<div class="row form-inline">
							<div class="col-xs-4">
								<div class="form-group">
									<label class="t"><span class="red">*</span> 昵称：</label>
									<div class="input-group">
										<input id="js-input-breed" type="text" value="<?php echo !empty($userMasterInfo['Nickname']) ? $userMasterInfo['Nickname'] : ''?>" name="nickname" class="form-control" placeholder="昵称">
									</div>
								</div>
							</div>
							<div class="col-xs-8">
								<div class="form-group">
									<label class="t"><span class="red">*</span> 性别：</label>
									<div class="input-group">
										<label><input type="radio" value="2" checked name="sex" /> 美女</label>&nbsp;&nbsp;&nbsp;
										<label><input type="radio" value="1" <?php echo (!empty($userMasterInfo['Sex']) && $userMasterInfo['Sex'] == 1) ? 'checked' : '' ?> name="sex" /> 帅哥</label>&nbsp;&nbsp;&nbsp;
									</div>
								</div>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-4">
								<div class="form-group">
									<label class="t"><span class="red">*</span> 生日：</label>
									<select class="form-control" def="<?php echo date('Y', $userMasterInfo['Birthday']) ?>" name="y" id="birthday-y">
										<option>年</option>
									</select>
									<select class="form-control" def="<?php echo date('m', $userMasterInfo['Birthday']) ?>" name="m" id="birthday-m">
										<option>月</option>
									</select>
									<select class="form-control" def="<?php echo date('d', $userMasterInfo['Birthday']) ?>" name="d" id="birthday-d">
										<option>日</option>
									</select>
								</div>
							</div>
							<div class="col-xs-8">
								<div class="form-group">
									<label class="t">养狗经验：</label>
									<div class="input-group">
										<input type="number" value="<?php echo !empty($userMasterInfo['Experience']) ? $userMasterInfo['Experience'] : ''?>" name="experience" class="form-control" placeholder="养狗经验">
										<div class="input-group-addon">月</div>
									</div>
								</div>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-4">
								<div class="form-group">
									<label class="t">职业：</label>
									<div class="input-group">
										<input type="text" value="<?php echo !empty($userMasterInfo['Profession']) ? $userMasterInfo['Profession'] : ''?>" name="profession" class="form-control" placeholder="职业">
									</div>
								</div>
							</div>
							<div class="col-xs-8">
								<div class="form-group">
									<label class="t">狗狗个数：</label>
									<div class="input-group">
										<input type="number" value="<?php echo !empty($userMasterInfo['DogNumber']) ? $userMasterInfo['DogNumber'] : ''?>" name="dogNumber" class="form-control" placeholder="狗狗个数">
										<div class="input-group-addon">个</div>
									</div>
								</div>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-12">
								<label class="t">我对主人的评价：</label>
							</div>
							<div class="col-xs-8 form-group">
								<textarea name="desc" class="form-control" rows="3" placeholder="我对主人的评价"><?php echo !empty($userMasterInfo['Desc']) ? $userMasterInfo['Desc'] : ''?></textarea>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-8">
								<div class="alert alert-danger alert-dismissible" style="display: none;" role="alert">
									<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
									<span class="msg">...</span>
								</div>
							</div>
							<div class="clearfix"></div>
							<div class="col-xs-8">
								<a href="javascript:;" class="btn btn-default" onclick="$(this).closest('.well').find('.js-show-hide-edit').click()">取消</a>&nbsp;&nbsp;&nbsp;&nbsp;
								<button type="submit" class="btn btn-success">保存</button>
							</div>
							<div class="clearfix"></div>
						</div>
					</form>
				</dd></dl>
			</div>
		</div>
<!--		<div class="well dog-info">-->
<!--			<p class="bg-title title">你可能感兴趣的？</p>-->
<!--			<div class="desc dog-photo">-->
<!--				<div>-->
<!--					<a href="javascript:;" class="thumbnail">-->
<!--						<img src="/Resource/images/pt_3.jpg">-->
<!--					</a>-->
<!--					<a href="javascript:;" class="thumbnail">-->
<!--						<img src="/Resource/images/pt_3.jpg">-->
<!--					</a>-->
<!--					<a href="javascript:;" class="thumbnail">-->
<!--						<img src="/Resource/images/pt_3.jpg">-->
<!--					</a>-->
<!--					<a href="javascript:;" class="thumbnail">-->
<!--						<img src="/Resource/images/pt_3.jpg">-->
<!--					</a>-->
<!--					<a href="javascript:;" class="thumbnail">-->
<!--						<img src="/Resource/images/pt_3.jpg">-->
<!--					</a>-->
<!--					<a href="javascript:;" class="thumbnail">-->
<!--						<img src="/Resource/images/pt_3.jpg">-->
<!--					</a>-->
<!--					<a href="javascript:;" class="thumbnail">-->
<!--						<img src="/Resource/images/pt_3.jpg">-->
<!--					</a>-->
<!--				</div>-->
<!---->
<!--			</div>-->
<!--		</div>-->
	</div>
<?php $this->import('Footer') ?>
<script>
	seajs.init();
</script>